package com.sam.gui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.webkit.*;

import com.sam.gui.base.BaseWebActivity;
import com.sam.ui.base.activity.BaseActivity;

public class MyAddressListWebActivity extends BaseWebActivity {

    @Override
    protected void initView() {
        super.initView();
        setContentUrl("index.php?c=user&a=user_myinfo_by_address");
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch (resultCode) { //resultCode为回传的标记，我在B中回传的是RESULT_OK
            case 999:
                reload();
                break;
            default:
                break;
        }
        super.onActivityResult(requestCode, resultCode, data);
    }

    @JavascriptInterface
    public void address_add(){
        Intent intent = new Intent(this, AddMyAddressWebActivity.class);
        startActivityForResult(intent, 999);
    }
    @JavascriptInterface
    public void edit_address(String id){
        Intent intent = new Intent(this, AddressDetailWebActivity.class);
        Bundle bundle = new Bundle();
        bundle.putString("id", id);
        intent.putExtras(bundle);
        startActivityForResult(intent, 999);
    }

    @JavascriptInterface
    public void submitSuccess(){
        webView.reload();

    }
}
